package com.rqf.ls.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rqf.ls.service.ICommonDataService;
import com.rqf.ls.service.IManagementBenefitService;
import com.server.web.DataVector;
import com.server.web.RequestInput;

@Service("ManagementBenefitService")
public class ManagementBenefitService implements IManagementBenefitService {
	
	@Autowired
	private ICommonDataService commonDataService;
	
	 /**
	 * 参加公益活动的所有用户
	 * @param requestInput
	 * @param userType
	 * @return
	 * @author ServerZhang
	 * @date 2016年5月18日
	 */
	@Override
	public DataVector<Map<String, Object>> userList(RequestInput requestInput, String userType){
		String table = "SIGNUP";
		if ("normal".equals(userType)) {
			table = "V_SIGNUP_NORMALUSER";
		}else if ("lawyer".equals(userType)){
			table = "V_SIGNUP_LAWYERUSER";
		}else {
			
		}
		String _whereStr = "";
		String sortStr = "";
		DataVector<Map<String, Object>> listData = commonDataService.getListData(table, _whereStr, sortStr, requestInput);
		return listData;
	}
	
	/**
	 * 所有公益活动列表
	 * @param requestInput
	 * @param userType
	 * @return
	 * @author ServerZhang
	 * @date 2016年5月18日
	 */
	@Override
	public DataVector<Map<String, Object>> getList(RequestInput requestInput, 
			String phoneNo, String userType){
		String table = "SIGNUP";
		String _whereStr = "USERTYPE='"+userType+"' and PHONENO='"+phoneNo+"'";
		String sortStr = "createtime desc";
		DataVector<Map<String, Object>> listData = commonDataService.getListData(table, _whereStr, sortStr, requestInput);
		return listData;
	}
}
